Show AllShow All

Subtotal Method

ShowSubtotal method as it applies to the WorksheetFunction object.

ShowSubtotal method as it applies to the Range object.

Example

This example creates subtotals for the selection on Sheet1. The subtotals are sums grouped by each change in field one, with the subtotals added to fields two and three.

Worksheets("Sheet1").Activate
Selection.Subtotal GroupBy:=1, Function:=xlSum, _
    TotalList:=Array(2, 3)